package com.bjesc_b2c.app.appraiset.mvp.presenter.impl;

import android.content.Context;

import com.bjesc_b2c.app.appraiset.bean.DealerCarBean;
import com.bjesc_b2c.app.appraiset.bean.XDPostBean;
import com.bjesc_b2c.app.appraiset.mvp.model.XDModel;
import com.bjesc_b2c.app.appraiset.mvp.model.impl.XDModelImpl;
import com.bjesc_b2c.app.appraiset.mvp.presenter.XDPresenter;
import com.bjesc_b2c.app.appraiset.mvp.view.XDView;

import rxretrofit_base.model.TokenBean;

/**
 * Created by yidong on 2017/7/27.
 */

public class XDPresenterImpl implements XDPresenter,XDModelImpl.CallBack {
    private XDView view;
    private XDModel model;

    public XDPresenterImpl(XDView view) {
        this.view = view;
        model = new XDModelImpl(this);
    }

    @Override
    public void addCar(Context context, String dealerId, String vin) {
        model.addCar(context,dealerId,vin);
    }

    @Override
    public void alreadyInventory(Context context, String id) {
        model.alreadyInventory(context,id);
    }

    @Override
    public void carUnusual(Context context, String dealerId, String carId) {
        model.carUnusual(context,dealerId,carId);
    }

    @Override
    public void loadStart() {
        view.loadStart();
    }

    @Override
    public void loadCompleted() {
        view.loadCompleted();
    }

    @Override
    public void loadFailure() {
        view.loadFailure();
    }

    @Override
    public void getDealerCar(Context context, XDPostBean bean) {
        model.getDealerCar(context,bean);
    }

    @Override
    public void callback(DealerCarBean bean) {
        view.getDealerCars(bean);
    }

    @Override
    public void onSuccess(TokenBean bean) {
        view.panKuSuccess(bean);
    }
}
